package com.one.consumer.order.presenter;

import android.content.Context;

import com.one.common.model.bean.PayWXBean;
import com.one.common.model.http.callback.ObserverOnResultListener;
import com.one.common.presenter.BaseApiPresenter;
import com.one.common.utils.Logger;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.base.IListView;
import com.one.consumer.order.model.OrderModel;
import com.one.consumer.reserve.model.item.CustomItem;
import com.one.consumer.reserve.model.item.ReserveItem;

import java.util.ArrayList;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/10/21 下午4:55
 * description ：
 **/
public class OrderPresenter extends BaseApiPresenter<IListView, OrderModel> {
    public OrderPresenter(IListView mView, Context mContext) {
        super(mView, mContext, new OrderModel((BaseActivity) mContext));
    }

    public OrderPresenter( Context mContext) {
        super(null, mContext, new OrderModel((BaseActivity) mContext));
    }


    /**
     * 获取装修订单列表
     */
    public void getDEOrderList(){
        mModel.getDEList(mView.getPage() + "", new ObserverOnResultListener<ArrayList<ReserveItem>>() {
            @Override
            public void onResult(ArrayList<ReserveItem> orderItems) {
                if(mView!=null){
                    mView.loadSuccess(orderItems);
                }
            }
        });
    }

    /**
     * 获取装配订单列表
     */
    public void getCUOrderList(){
        mModel.getCustomList(mView.getPage() + "", new ObserverOnResultListener<ArrayList<CustomItem>>() {
            @Override
            public void onResult(ArrayList<CustomItem> orderItems) {
                if(mView!=null){
                    mView.loadSuccess(orderItems);
                }
            }
        });
    }

}
